package asimes.datastructure.queue;

import java.util.Arrays;
import java.util.PriorityQueue;

public class TestQueue {
    public static void main(String[] args) {
        PriorityQueue<String> priorityQueue = new PriorityQueue<>();
        priorityQueue.add("A");
        priorityQueue.add("E");
        priorityQueue.add("C");
        priorityQueue.add("D");
        priorityQueue.add("B");

        while (!priorityQueue.isEmpty()) {
            System.out.println(priorityQueue.poll());
        }
        PriorityQueue<Character> priorityQueue1 = new PriorityQueue<>();
        priorityQueue1.add('A');
        priorityQueue1.add('E');
        priorityQueue1.add('C');
        priorityQueue1.add('D');
        priorityQueue1.add('B');
        while (!priorityQueue1.isEmpty()) {
            System.out.println(priorityQueue1.poll());
        }
        String[] strings = new String[]{"A", "E", "C", "D", "B"};
        Arrays.sort(strings);
        for (int i = 0; i < strings.length; i++) {
            System.out.println(strings[i]);
        }
    }
}
